home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / tool-inc.zip / GETKEY.INC < prev    next >
Text File  |  1989-06-02  |  2KB  |  75 lines

  1.  
  2. (*
  3.  * Copyright 1987, 1989 Samuel H. Smith;  All rights reserved
  4.  *
  5.  * This is a component of the ProDoor System.
  6.  * Do not distribute modified versions without my permission.
  7.  * Do not remove or alter this notice or any other copyright notice.
  8.  * If you use this in your own program you must distribute source code.
  9.  * Do not use any of this in a commercial product.
  10.  *
  11.  *)
  12.  
  13. (*
  14.  * function key and other keyboard entry definition
  15.  * shs (rev. 12-nov-87)
  16.  *
  17.  *)
  18.  
  19. const
  20.    YES         = 'Y';
  21.    NO          = 'N';
  22.    BACKSPACE   = #8;
  23.    TAB         = #9;
  24.    NEWLINE     = #13;
  25.    ESC         = #27;
  26.    F1          = #201;
  27.    F2          = #202;
  28.    F3          = #203;
  29.    F4          = #204;
  30.    F5          = #205;
  31.    F6          = #206;
  32.    F7          = #207;
  33.    F8          = #208;
  34.    F9          = #209;
  35.    F10         = #210;
  36.    HOME        = #213;
  37.    UP          = #214;
  38.    PGUP        = #215;
  39.    LEFT        = #217;
  40.    RIGHT       = #219;
  41.    ENDK        = #221;
  42.    DOWN        = #222;
  43.    PGDN        = #223;
  44.    INS         = #224;
  45.    DEL         = #225;
  46.    CTRL_F1     = #236;
  47.    CTRL_F2     = #237;
  48.    CTRL_F3     = #238;
  49.    CTRL_F9     = #244;
  50.    CTRL_F10    = #245;
  51.    CTRL_PGUP   = #18;
  52.    CTRL_PGDN   = #4;
  53.    CTRL_LEFT   = #1;
  54.    CTRL_RIGHT  = #2;
  55.    CTRL_HOME   = #5;
  56.    CTRL_END    = #3;
  57.  
  58. function getkey: char;
  59. var
  60.    key: char;
  61.  
  62. begin
  63.    key := crt.readkey;
  64.  
  65.    if (key = #0) then
  66.    begin
  67.       key := crt.readkey;
  68.       key := chr( lo( ord( key )+ 142 ));
  69.                               {convert function keys to 201..210}
  70.    end;
  71.  
  72.    getkey := key;
  73. end;
  74.  
  75.